import Vue from 'vue'
import Router from 'vue-router'

// in development-env not use lazy-loading, because lazy-loading too many pages will cause webpack hot update too slow. so only in production use lazy-loading;
// detail: https://panjiachen.github.io/vue-element-admin-site/#/lazy-loading

Vue.use(Router)

/* Layout */
import Layout from '../views/layout/Layout'

/**
 * hidden: true                   if `hidden:true` will not show in the sidebar(default is false)
 * alwaysShow: true               if set true, will always show the root menu, whatever its child routes length
 *                                if not set alwaysShow, only more than one route under the children
 *                                it will becomes nested mode, otherwise not show the root menu
 * redirect: noredirect           if `redirect:noredirect` will no redirct in the breadcrumb
 * name:'router-name'             the name is used by <keep-alive> (must set!!!)
 * meta : {
    title: 'title'               the name show in submenu and breadcrumb (recommend set)
    icon: 'svg-name'             the icon show in the sidebar,
  }
 **/
export const constantRouterMap = [
  {path: '/login', component: () => import('@/views/login/index'), hidden: true},
  {path: '/404', component: () => import('@/views/404'), hidden: true},
  {
    path: '/redirect',
    component: Layout,
    hidden: true,
    children: [
      {
        path: '/redirect/:path*',
        component: () => import('@/views/redirect/index')
      }
    ]
  },
  {
    path: '',
    component: Layout,
    redirect: 'dashboard',
    children: [{
      path: 'dashboard',
      component: () => import('@/views/dashboard/index'),
      name: '工作台',
      meta: {title: '工作台', icon: 'example', noCache: true}
    }]
  },
]

export default new Router({
  // mode: 'history', //后端支持可开
  scrollBehavior: () => ({y: 0}),
  routes: constantRouterMap
})

export const asyncRouterMap = [
  {
    path: '/insurance',
    component: Layout,
    redirect: '/insurance/list',
    name: '保险管理',
    meta: {
      title: '保险管理', icon: 'baoxainguanli',
      roles: [
        'admin:insurance:company:list',
        'admin:insurance:service:supplier:list',
        'admin:insurance:service:employee:list',
        'admin:car:insurance:inquiry:list',
        'admin:insurance:classify:list',
        'admin:insurance:info:list'
      ]
    },
    children: [
      {
        path: 'company/list',
        name: '保险公司',
        component: () => import('@/views/insurance/insuranceCompanyIndex'),
        meta: {
          title: '保险公司',
          icon: 'baoxiangongsi',
          roles: [
            'admin:insurance:company:list'
          ]
        }
      },
      {
        path: 'service/prodiver/list',
        name: '保险服务商',
        component: () => import('@/views/insurance/insuranceServiceProdiverIndex'),
        meta: {
          title: '保险服务商',
          icon: 'baoxianfuwushang',
          roles: [
            'admin:insurance:service:supplier:list'
          ]
        }
      },
      {
        path: 'service/prodiver/employee/list',
        name: '保险服务商员工',
        component: () => import('@/views/insurance/insuranceEmployeeIndex'),
        meta: {
          title: '保险服务商员工',
          icon: 'fuwushangyuangong',
          roles: [
            'admin:insurance:service:employee:list'
          ]
        }
      },
      {
        path: 'car/inquiry',
        name: '车险咨询',
        component: () => import('@/views/insurance/carInsuranceInquiryIndex'),
        meta: {
          title: '车险咨询',
          icon: 'chexianzixun',
          roles: [
            'admin:car:insurance:inquiry:list'
          ]
        }
      },
      {
        path: 'car/inquiry/detail',
        name: '车险咨询详情',
        hidden: true,
        component: () => import('@/views/insurance/carInsuranceInquiryDetail'),
        meta: {
          title: '车险咨询详情',
          icon: 'chexianzixun',
          roles: [
            'admin:car:insurance:inquiry:list'
          ]
        }
      },
      {
        path: 'classify/list',
        name: '保险分类管理',
        component: () => import('@/views/insurance/insuranceClassifyIndex'),
        meta: {
          title: '保险分类管理',
          icon: 'baoxianfenlei',
          roles: [
            'admin:insurance:classify:list'
          ]
        }
      },
      {
        path: 'product/list',
        name: '保险产品管理',
        component: () => import('@/views/insurance/insuranceProductIndex'),
        meta: {
          title: '保险产品管理',
          icon: 'baoxianchanpin',
          roles: [
            'admin:insurance:info:list'
          ]
        }
      },
      {
        path: 'product/info/:type',
        name: 'insuranceProductDetail',
        hidden: true,
        component: () => import('@/views/insurance/insuranceProductDetail'),
        meta: {
          title: '保险产品详情',
          icon: 'chexianzixun',
          roles: [
            'admin:insurance:info:list'
          ]
        }
      },
    ]
  },
  {
    path: '/insurance/order',
    component: Layout,
    redirect: '/list',
    name: '保险订单',
    meta: {
      title: '保险订单', icon: 'order',
      roles: [
        'admin:insurance:order:list'
      ]
    },
    children: [
      {
        path: 'list',
        name: '保险订单',
        component: () => import('@/views/order/index'),
        meta: {
          title: '保险订单',
          icon: 'order',
          roles: [
            'admin:insurance:order:list'
          ]
        }
      }
    ]
  },
  {
    path: '/industry',
    component: Layout,
    redirect: '/list',
    name: '行业列表',
    meta: {
      title: '行业列表', icon: 'order',
      roles: [
        'admin:industry:list'
      ]
    },
    children: [
      {
        path: 'list',
        name: '行业列表',
        component: () => import('@/views/industry/index'),
        meta: {
          title: '行业列表',
          icon: 'order',
          roles: [
            'admin:industry:list'
          ]
        }
      }
    ]
  },

  {
    path: '/arbitrationBussiness',
    component: Layout,
    redirect: 'transportConfirm/list',
    name: '仲裁业务',
    alwaysShow: true,
    meta: {
      title: '仲裁业务', icon: 'caiwu', roles: [
        'admin:arbitration:list',
        'admin:transportConfirm:list'
      ]
    },
    children: [
      {
        path: 'transportConfirm/list',
        name: '运输确认单',
        component: () => import('@/views/arbitration/transportConfirmIndex'),
        meta: {
          title: '运输确认单',
          icon: 'dailishang',
          roles: [
            'admin:transportConfirm:list'
          ]
        }
      },
      {
        path: 'arbitration/list',
        name: '仲裁申诉处理',
        component: () => import('@/views/arbitration/arbitrationIndex'),
        meta: {
          title: '仲裁申诉处理',
          icon: 'dailishang',
          roles: [
            'admin:arbitration:list'
          ]
        }
      }
    ]
  },
  {
    path: '/accident/report',
    component: Layout,
    redirect: '/list',
    name: '事故上报',
    meta: {
      title: '事故上报', icon: 'shigushangbao',
      roles: [
        'admin:accident:report:list',
        'admin:accident:report:service:list'
      ]
    },
    children: [
      {
        path: 'list',
        name: '事故上报',
        component: () => import('@/views/accidentreport/index'),
        meta: {
          title: '事故上报',
          icon: 'shigushangbao',
          roles: [
            'admin:accident:report:list'
          ]
        }
      },
      {
        path: 'service/list',
        name: '事故上报',
        component: () => import('@/views/accidentreport/serviceIndex'),
        meta: {
          title: '事故上报',
          icon: 'shigushangbao',
          roles: [
            'admin:accident:report:service:list'
          ]
        }
      }
    ]
  },
  {
    path: '/rescue',
    component: Layout,
    redirect: '/rescue/order/list',
    name: '救援业务',
    meta: {
      title: '救援业务', icon: 'rescue1', roles: [
        'admin:worksheets:operation:list',
        'admin:worksheets:list',
        'admin:worksheets:template:list',
        'admin:rescue:company:list',
        'admin:rescue:company:employee:driver:operation:list',
        'admin:rescue:company:employee:driver:list',
        'admin:online:service:company:list',
        'admin:rescue:car:list',
        'admin:rescue:car:operation:list'
      ]
    },
    children: [
      {
        path: 'order/list',
        name: '工单列表',
        component: () => import('@/views/rescue/workorder'),
        meta: {
          title: '工单列表',
          icon: 'workorder1',
          roles: [
            'admin:worksheets:operation:list', 'admin:worksheets:list'
          ]
        }
      },
      {
        path: 'order/template/list',
        name: '工单模板',
        component: () => import('@/views/rescue/workorder/orderTemplate'),
        meta: {
          title: '工单模板',
          icon: 'ordersetting',
          roles: [
            'admin:worksheets:template:list'
          ]
        }
      },
      // {
      //   path: 'order/template/setting',
      //   name: '模板设置',
      //   component: () => import('@/views/rescue/workorder/templateSetting'),
      //   meta: {
      //     title: '模板设置',
      //     icon: 'orderrelate',
      //     roles: [
      //       'admin:online:service:company:list'
      //     ]
      //   }
      // },
      {
        path: 'online/service',
        name: '网络平台',
        component: () => import('@/views/rescue/baseData/onlineServiceIndex'),
        meta: {
          title: '网络平台',
          icon: 'wlpt',
          roles: [
            'admin:online:service:company:list'
          ]
        }
      },
      {
        path: 'province/agent',
        name: '省代管理',
        component: () => import('@/views/rescue/baseData/rescueProvinceAgentIndex'),
        meta: {
          title: '省代管理',
          icon: 'dailishang',
          roles: [
            'admin:agent:info:prodiver:list'
          ]
        }
      },
      {
        path: 'agent',
        name: '救援代理人',
        component: () => import('@/views/rescue/baseData/rescueAgentIndex'),
        meta: {
          title: '救援代理人',
          icon: 'dailishang',
          roles: [
            'admin:agent:info:list'
          ]
        }
      },
      {
        path: 'company',
        name: '救援公司',
        component: () => import('@/views/rescue/baseData/rescueCompanyIndex'),
        meta: {
          title: '救援公司',
          icon: 'jiuyuan',
          roles: [
            'admin:rescue:company:operation:list',
            'admin:rescue:company:list'
          ]
        }
      },
      {
        path: 'operation/employee',
        name: 'operationRescueEmployee',
        component: () => import('@/views/rescue/baseData/operationRescueEmployeeIndex'),
        meta: {
          title: '救援员工',
          icon: 'employee',
          roles: [
            'admin:rescue:company:employee:driver:operation:list'
          ]
        }
      },
      {
        path: 'employee',
        name: 'rescueEmployee',
        component: () => import('@/views/rescue/baseData/rescueEmployeeIndex'),
        meta: {
          title: '救援员工',
          icon: 'employee',
          roles: [
            'admin:rescue:company:employee:driver:list'
          ]
        }
      },
      {
        path: 'car',
        name: 'car',
        component: () => import('@/views/rescue/baseData/carIndex'),
        meta: {
          title: '拖车管理',
          icon: 'driver',
          roles: [
            'admin:rescue:car:list'
          ]
        }
      },
      {
        path: 'car/operation',
        name: 'operationCar',
        component: () => import('@/views/rescue/baseData/operationCarIndex'),
        meta: {
          title: '拖车管理',
          icon: 'driver',
          roles: [
            'admin:rescue:car:operation:list'
          ]
        }
      }
    ]
  },

  {
    path: '/opereration/report',
    component: Layout,
    redirect: '/list',
    name: '运营报表',
    alwaysShow: true,
    meta: {
      title: '运营报表', icon: 'caiwu', roles: [
        'admin:pay:record:list',
        'admin:sign:user:list'
      ]
    },
    children: [
      {
        path: 'list',
        name: '服务商佣金',
        component: () => import('@/views/operationreport/index'),
        meta: {
          title: '服务商佣金',
          icon: 'dailishang',
          roles: [
            'admin:sign:user:list'
          ]
        }
      },
      {
        path: 'pay/list',
        name: '支付流水',
        component: () => import('@/views/operationreport/payRecordIndex'),
        meta: {
          title: '支付流水',
          icon: 'dailishang',
          roles: [
            'admin:pay:record:list'
          ]
        }
      },
      {
        path: 'agencyInfo',
        name: '推广人下线',
        component: () => import('@/views/operationreport/agencyInfo'),
        meta: {
          title: '推广人下线',
          icon: 'dailishang',
          roles: [
            'admin:pay:record:list'
          ]
        }
      },
      {
        path: 'index',
        component: () => import('@/views/webagencyinfo/index'),
        name: '我的下线',
        meta: {
          title: '我的下线',
          icon: 'dailishang',
          roles: [
            'admin:transportConfirm:list'
          ]
        }
      },
    ]
  },

  {
    path: '/finance',
    component: Layout,
    redirect: '/list',
    name: '财务管理',
    meta: {
      title: '财务管理', icon: 'caiwu', roles: [
        'admin:agent:info:payables:list',
        'admin:rescue:company:employee:manager:payables:list',
        'admin:rescue:company:employee:driver:payables:list',
        'admin:accident:report:pay:info:list'
      ]
    },
    children: [
      {
        path: 'agent/list',
        name: '救援代理应付款',
        component: () => import('@/views/finance/agentPayableIndex'),
        meta: {
          title: '救援代理应付款',
          icon: 'dailishang',
          roles: [
            'admin:agent:info:payables:list'
          ]
        }
      },
      {
        path: 'manager/list',
        name: '救援公司应付款',
        component: () => import('@/views/finance/managerPayableIndex'),
        meta: {
          title: '救援公司应付款',
          icon: 'jiuyuan',
          roles: [
            'admin:rescue:company:employee:manager:payables:list'
          ]
        }
      },
      {
        path: 'driver/list',
        name: '救援司机应付款',
        component: () => import('@/views/finance/driverPayableIndex'),
        meta: {
          title: '救援司机应付款',
          icon: 'employee',
          roles: [
            'admin:rescue:company:employee:driver:payables:list'
          ]
        }
      },
      {
        path: 'receivable/list',
        name: '保险公司应收款',
        component: () => import('@/views/finance/payInfoIndex'),
        meta: {
          title: '保险公司应收款',
          icon: 'yingshoukuan',
          roles: [
            'admin:accident:report:pay:info:list'
          ]
        }
      },
      {
        path: 'collectionorder/index',
        name: '财务应收款',
        component: () => import('@/views/collectionorder/index'),
        meta: {
          title: '财务应收款',
          icon: 'yingshoukuan',
          roles: [
            'admin:accident:report:pay:info:list'
          ]
        }
      },
      {
        path: 'collectionorder/detail',
        name: '财务应收款详情',
        hidden:true,
        component: () => import('@/views/collectionorder/detail'),
        meta: {
          title: '财务应收款详情',
          icon: 'yingshoukuan',
          roles: [
            'admin:accident:report:pay:info:list'
          ]
        }
      }
    ]
  },

  {
    path: '/service/provider',
    component: Layout,
    redirect: '/manager/list',
    name: '服务商管理',
    meta: {
      title: '服务商管理', icon: 'serviceprovider', roles: [
        'admin:role:service:list',
        'admin:sign:user:list',
        'admin:insurance:service:employee:manager:list',
        'admin:agent:info:audit:*',
        'admin:rescue:company:employee:manager:list',
        'admin:rescue:company:employee:driver:audit:list'
      ]
    },
    children: [
      {
        path: 'role/list',
        name: '服务商角色',
        component: () => import('@/views/serviceprovider/serviceProviderRoleIndex'),
        meta: {
          title: '服务商角色',
          icon: 'user_role',
          roles: [
            'admin:role:service:list'
          ]
        }
      },
      {
        path: 'user/list',
        name: '服务商用户',
        component: () => import('@/views/serviceprovider/serviceProviderUserIndex'),
        meta: {
          title: '服务商用户',
          icon: 'LC_icon_user_group_fill',
          roles: [
            'admin:sign:user:list'
          ]
        }
      },
      {
        path: 'insurance/list',
        name: '保险服务商审核',
        component: () => import('@/views/serviceprovider/insuranceServiceSupplierAuditIndex'),
        meta: {
          title: '保险服务商审核',
          icon: 'baoxianfuwushang',
          roles: [
            'admin:insurance:service:employee:manager:list'
          ]
        }
      },
      {
        path: 'agent/list',
        name: '救援代理人审核',
        component: () => import('@/views/serviceprovider/rescueAgentAuditIndex'),
        meta: {
          title: '救援代理人审核',
          icon: 'dailishangshenhe',
          roles: [
            'admin:agent:info:audit:*'
          ]
        }
      },
      {
        path: 'manager/list',
        name: '救援负责人审核',
        component: () => import('@/views/serviceprovider/rescueManagerAuditIndex'),
        meta: {
          title: '救援负责人审核',
          icon: 'manager',
          roles: [
            'admin:rescue:company:employee:manager:list'
          ]
        }
      },
      {
        path: 'driver/list',
        name: '救援司机审核',
        component: () => import('@/views/serviceprovider/rescueDriverAuditIndex'),
        meta: {
          title: '救援司机审核',
          icon: 'driver',
          roles: [
            'admin:rescue:company:employee:driver:audit:list'
          ]
        }
      }
    ]
  },

  {
    path: '/form',
    component: Layout,
    redirect: '/form/component/list',
    name: '表单管理',
    meta: {
      title: '表单管理', icon: 'form', roles: [
        'admin:control:list',
        'admin:form:template:list'
      ]
    },
    children: [
      {
        path: 'component/list',
        name: '组件管理',
        component: () => import('@/views/form/control/index'),
        meta: {
          title: '组件管理',
          icon: 'component',
          roles: [
            'admin:control:list'
          ]
        }
      },
      {
        path: 'component/detail',
        name: '组件详情',
        hidden: true,
        component: () => import('@/views/form/control/controlProperty'),
        meta: {title: '组件详情', icon: 'module', roles: ['admin:control:list']}
      },
      {
        path: 'template',
        name: '表单模板',
        component: () => import('@/views/form/template/index'),
        meta: {
          title: '表单模板',
          icon: 'form_setting',
          roles: [
            'admin:form:template:list'
          ]
        }
      },
      {
        path: 'template/detail',
        name: '模板详情',
        hidden: true,
        component: () => import('@/views/form/template/templateDetail'),
        meta: {title: '模板详情', icon: 'module', roles: ['admin:form:template:list']}
      },
      {
        path: 'group/detail',
        name: '组详情',
        hidden: true,
        component: () => import('@/views/form/template/groupDetail'),
        meta: {title: '组详情', icon: 'module', roles: ['admin:form:template:list']}
      }
    ]
  },

  {
    path: '/system',
    component: Layout,
    redirect: '/system/organization/list',
    name: '系统管理',
    meta: {
      title: '系统管理', icon: 'qcSystem', roles: [
        'admin:organization:list',
        'admin:user:list',
        'admin:role:list',
        'admin:dictionary:list',
        'admin:log:list',
        'admin:sys:info:setting:list'
      ]
    },
    children: [
      {
        path: 'organization/list',
        name: '部门管理',
        component: () => import('@/views/system/organization/index'),
        meta: {
          title: '部门管理',
          icon: 'organization',
          roles: [
            'admin:organization:list'
          ]
        }
      },
      {
        path: 'user/list',
        name: '员工管理',
        component: () => import('@/views/system/user/index'),
        meta: {
          title: '员工管理', icon: 'LC_icon_user_group_fill', roles: [
            'admin:user:list'
          ]
        }
      },
      {
        path: 'user/info/:type',
        name: '员工信息',
        component: () => import('@/views/system/user/userInfo'),
        hidden: true,
        meta: {
          title: '员工信息', icon: 'LC_icon_user_group_fill', roles: [
            'admin:user:update:*'
          ]
        }
      },
      {
        path: 'role/list',
        name: '角色管理',
        component: () => import('@/views/system/role/index'),
        meta: {
          title: '角色管理', icon: 'user_role', roles: [
            'admin:role:list'
          ]
        }
      },
      {
        path: 'module/list',
        name: '模块管理',
        component: () => import('@/views/system/module/index'),
        meta: {
          title: '模块管理', icon: 'module', roles: [
            'admin:module:list'
          ]
        }
      },
      {
        path: 'module/detail',
        name: '模块详情',
        hidden: true,
        component: () => import('@/views/system/module/moduleDetail'),
        meta: {title: '模块详情', icon: 'organization'
          , roles: [
            'admin:module:list'
          ]
        }
      },
      {
        path: 'dictionary',
        name: '数据字典',
        component: () => import('@/views/system/dictionary/index'),
        meta: {
          title: '数据字典', icon: 'dictionary', roles: [
            'admin:dictionary:list'
          ]
        }
      },
      {
        path: 'log',
        name: '日志管理',
        component: () => import('@/views/system/log/index'),
        meta: {
          title: '日志管理', icon: 'log', roles: [
            'admin:log:list'
          ]
        }
      },
      {
        path: 'protocol',
        name: '协议管理',
        component: () => import('@/views/system/protocol/index'),
        meta: {
          title: '协议管理', icon: 'log', roles: [
            'admin:log:list'
          ]
        }
      },
      {
        path: 'system/templatemessage',
        name: '通知模板管理',
        component: () => import('@/views/templatemessage/index'),
        meta: {
          title: '通知模板管理', icon: 'tongzhimoban', roles: [
            'admin:sys:info:setting:list'
          ]
        }
      },
      {
        path: 'system/setting',
        name: '运营参数',
        component: () => import('@/views/system/setting/index'),
        meta: {
          title: '运营参数', icon: 'System', roles: [
            'admin:sys:info:setting:list'
          ]
        }
      }
    ]
  },
  {
    path: '/truckorder',
    component: Layout,
    alwaysShow: true,
    redirect: '/truckorder/ordercenter',
    name: '任务中心',
    meta: {
      title:'任务中心',
      icon: 'caiwu', roles: [
        'admin:arbitration:list',
        'admin:transportConfirm:list'
      ]
    },
    children: [
      {
        path: 'ordercenter',
        component: () => import('@/views/truckorder/ordercenter/index'),
        name: '委托中心',
        meta: {
          title:'委托中心',
          icon: 'dailishang',
          roles: [
            'admin:transportConfirm:list'
          ]
        }
      },
      {
        path: 'ordercenterdetail',
        component: () => import('@/views/truckorder/ordercenter/detail'),
        hidden:true,
        name: '委托单详情',
        meta: {
          title:'委托单详情',
          icon: 'dailishang',
          roles: [
            'admin:transportConfirm:list'
          ]
        }
      },
      {
        path: 'truckcenter',
        component: () => import('@/views/truckorder/truckcenter/index'),
        name: '运力中心',
        meta: {
          title: '运力中心',
          icon: 'dailishang',
          roles: [
            'admin:arbitration:list'
          ]
        }
      },
      {
        path: 'truckcenterdetail',
        component: () => import('@/views/truckorder/truckcenter/detail'),
        name: '运输单详情',
        hidden:true,
        meta: {
          title:'运输单详情',
          icon: 'dailishang',
          roles: [
            'admin:transportConfirm:list'
          ]
        }
      },
    ]
  },
  {
    path: '/rescueApplyOrder',
    component: Layout,
    // alwaysShow: true,
    redirect: '/list',
    name: '救援申请单',
    meta: {
      title: '救援申请单',
      icon: 'caiwu', roles: [
        'admin:arbitration:list',
        'admin:transportConfirm:list'
      ]
    },
    children: [
      {
        path: 'list',
        component: () => import('@/views/rescueapply/list'),
        name: '医疗垫付申请单',
        meta: {
          title: '医疗垫付申请单',
          icon: 'jysqd',
          roles: [
            'admin:transportConfirm:list'
          ]
        }
      },
      {
        path: 'detail',
        component: () => import('@/views/rescueapply/detail'),
        hidden: true,
        name: '申请单详情',
        meta: {
          title: '申请单详情',
          icon: 'sqdxq',
          roles: [
            'admin:transportConfirm:list'
          ]
        }
      },
    ]
  },
  {
    path: '/complaintOrder',
    component: Layout,
    // alwaysShow: true,
    redirect: '/index',
    name: '申诉单',
    meta: {
      title: '申诉单',
      icon: 'caiwu', roles: [
        'admin:arbitration:list',
        'admin:transportConfirm:list'
      ]
    },
    children: [
      {
        path: 'index',
        component: () => import('@/views/complaintorder/index'),
        name: '申诉单',
        meta: {
          title: '申诉单',
          icon: 'jysqd',
          roles: [
            'admin:transportConfirm:list'
          ]
        }
      },
      {
        path: 'detail',
        component: () => import('@/views/complaintorder/detail'),
        hidden: true,
        name: '申诉单详情',
        meta: {
          title: '申诉单详情',
          icon: 'sqdxq',
          roles: [
            'admin:transportConfirm:list'
          ]
        }
      },
    ]
  },
  {
    path: '/cardorder',
    component: Layout,
    // alwaysShow: true,
    redirect: '/index',
    name: '会员卡运输单',
    meta: {
      title: '会员卡运输单',
      icon: 'caiwu', roles: [
        'admin:arbitration:list',
        'admin:transportConfirm:list'
      ]
    },
    children: [
      {
        path: 'index',
        component: () => import('@/views/cardorder/index'),
        name: '会员卡运输单',
        meta: {
          title: '会员卡运输单',
          icon: 'jysqd',
          roles: [
            'admin:transportConfirm:list'
          ]
        }
      },
      {
        path: 'setting',
        component: () => import('@/views/cardorder/setting'),
        name: '会员注册设置',
        meta: {
          title: '会员注册设置',
          icon: 'jysqd',
          roles: [
            'admin:transportConfirm:list'
          ]
        }
      },

    ]
  },
  {
    path: '/article',
    component: Layout,
    // alwaysShow: true,
    redirect: '/index',
    name: '文章管理',
    meta: {
      title: '文章管理',
      icon: 'caiwu', roles: [
        'admin:arbitration:list',
        'admin:transportConfirm:list'
      ]
    },
    children: [
      {
        path: 'index',
        component: () => import('@/views/article/index'),
        name: '文章管理',
        meta: {
          title: '文章管理',
          icon: 'jysqd',
          roles: [
            'admin:transportConfirm:list'
          ]
        }
      },
      {
        path: 'detail',
        component: () => import('@/views/article/detail'),
        name: '详情',
        hidden: true,
        meta: {
          title: '详情',
          icon: 'jysqd',
          roles: [
            'admin:transportConfirm:list'
          ]
        }
      },
      {
        path: 'add',
        component: () => import('@/views/article/add'),
        name: '编辑',
        hidden: true,
        meta: {
          title: '编辑',
          icon: 'jysqd',
          roles: [
            'admin:transportConfirm:list'
          ]
        }
      },
    ]
  },


  {path: '*', redirect: '/404', hidden: true}
]
